This invention relates generally to computer systems, and more particularly the invention relates to exception handling in a system using a coprocessor.
The conventional RISC such as the MIPS R3000 and R4000 are pipelined processors operating with a limited or reduced instruction set. The instruction pipeline includes instruction fetch (IF), read (RD), ALU or execute (EX), memory (MEM), and write back (WB). The processor includes a CPU and a system control co-processor for memory management and cache control. The CPU includes a general register file, an ALU, a shifter, a multiplier/divider, an address Addr, and a program counter. The MIPS R3000 and R4000 have compatible instruction sets except for the handling of exceptions.
The RISC microprocessor offers distinct advantages in reduced hardware complexity and thus reduced design time and required area in a VLSI chip implementation, a uniform and streamlined handling of instructions, and increase in computing speed. A disadvantage resulting from the limited instruction set is the need for a plurality of instructions in executing some functions. Further, many RISC systems have large CPU register files to support RISC program execution and instruction traffic.
The present invention is directed to an enhanced RISC microprocessor system which is compatible with both the R3000 and R4000 instruction sets in handling exceptions.
In accordance with the invention, a microprocessor CPU has an architecture which includes a combination of five independent execution units: ALU, load/store/add unit (LSU), which executes loads and stores as well as add and load immediate instructions, a branch unit, a multiply/shift unit, and a co-processor interface for interfacing with a plurality of co-processor units. A co-processor zero unit (CPO) is the system control processor that supports address translation, exception handling, and other privileged operations. Other customer-defined co-processor units can be added.
Exception processing is handled by the system control coprocessor (CPO) which has a plurality of registers that are used in exception processing. When an exception occurs, CPO loads an exception program counter (EPC) with a restart location where execution may resume after the exception has been serviced. The restart location is the address of the instruction that caused the exception or, if the instruction was executing in a branch delay slot, the address of the branch instruction immediately preceding the delay slot. The instruction causing the exception along with all those following in the pipeline are aborted. The CPO exception registers are examined during exception processing to determine the cause of an exception and the state of the CPU at the time of the exception. A Status register is a modification of the register of the R4000 architecture for upward compatibility of software written for processors based on the R3000 architecture.
The invention and objects and features thereof will be more readily apparent from the following detailed description and dependent claims when taken with the drawings.